package com.it.you.lang3;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.SerializationUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Slf4j
public class Lang3Test1 {

    public static void main(String[] args) {
        Lang lang = new Lang(1, "youhui");
        //使用lang3包中的序列化工具
        byte[] serialize = SerializationUtils.serialize(lang);
        System.out.println(serialize);
        //反序列化
        Object deserialize = SerializationUtils.deserialize(serialize);
        System.out.println(deserialize);

        String name = "you";
        String payType = "4";

        log.info("因客户在店铺的支付方式不支持{}移出后的剩余商品列表：{}",
                "1".equals(payType) ? "在线" : "账期", name);

//        System.out.println("\n");
//        System.out.println("youhui" + "\r\n");
        System.out.println("youhui\r");
        System.out.println("yy");

//        List<String> list = new ArrayList<>();
//        list.add("篮球");
//        list.add("排球");
//        lang.getBobbies().addAll(list);
//        System.out.println(JSONUtil.toJsonStr(lang));
//        List<String> stringList = lang.getBobbies().stream().filter(s -> s.equals("篮球")).collect(Collectors.toList());
//        lang.getBobbies().clear();
//        lang.getBobbies().addAll(stringList);
//        System.out.println(JSONUtil.toJsonStr(lang));

    }
}
